The editing window is the main part of the GUI around which all other features are drawn. Being a source-level editor, Workbench speeds up the process of writing code by having features such as Syntax Highlighting, Code-completion, Auto-completion and Code-folding. The Editing component of Workbench is based on the mature code of Scintilla, an embedded library in wxWidgets.
Using different colors to represent the typical identifiers in the editing window allows the developer to quickly identify mistakes such as open strings, unknown function calls and misplaced brackets. Colors are set to a default the first time the program is run, and if no changes are made there will be no settings saved. Otherwise the user will be able to click on the Options dialog and select any system color available from the palette. Once changes are made they will be saved to the users settings.xml file.
You can view the Color Settings section of this manual to discover how to set your own colors rather than the default that Workbench is shipped with.
Note: The grey line on the right side of the edit window represents the right edge set in your preferences, by default this value is set to 80.
Code-completion is one of the tools that is common to most development tools. Using a few keystrokes to start the name of the function call, a hot-key can be pressed (ctrl-space by default) that will bring up a listbox positioned underneath the cursor which shows the current matches to the list of known functions. This list of known functions will be derived from the internal PHP functions (see the online documentation at www.php.net) combined with the functions defined in the current script and the functions defined in any scripts that are included. If the token where the cursor is positioned with, begins with the '$' symbol, the list of variables within the current namespace is used to define the matchlist shown in the listbox.
![]() |
![]() |
Before | After |
Auto-completion is a function where a token is custom defined by the user that will be expanded when the hot-key (shift-space by default) is pressed. This feature is not dependant on the script that is currently being edited, it is not dependant on the namespace the cursor currently resides in, it is fully global in any file being edited.
The default hotkey for invoking Auto-completion is CTRL-J (previous in Maguma Studio it was SHIFT-SPACE). In the images above you can see it using one of the default auto-complete tokens installed with Workbench. In the "Before" image, the user types "classd" and then with the cursor positioned directly after the word hits CTRL-J which turns the token into the code that you see in the "After" image.
You can view the Auto Completion settings section to understand how to define your own auto-completion tokens and content.
One of the features that was first introduced in emacs was the ability to collapse a section of a file delimited by tokens and sort of "hide" it from the current view. For example if you have a large amount of functions defined at the beginning of your script but continously scroll between the top and the bottom in your current view you could "fold" the lines in between to shorten the amount of travel between sections. You could also use this feature to hide the finished code away from what you are concerned with at the moment.
For example:
becomes
as you can see the line numbers for the following lines are not affected in any manner, and the symbol next to the first line has become the '+' to represent that it is folded code. This is an automatic features built into the lexer as part of Scintilla and the only programmatic steps are creating the editor window with the secondary gutter space for the folding icon.
© 2004, Maguma GmbH, All Rights Reserved
All content provided in this document belongs to Maguma unless noted as the property of another company, institution or person.
Reproduction is not allowed without consent by a representative of Maguma GmbH. Please contact info@maguma.com with any queries.